<?php

/**
 * File: libs/database.php
 *
 * Instantiate PDO object
 *
 * @author     Philipp Petzold <pp@dezign.de>
 * @version    1.0
 */

// database settings
define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'root');
define('MYSQL_PASS', '');
define('MYSQL_SCHEMA', 'english_trainee');

// try to instantiate an pdo object
try
{
    $database = new PDO('mysql:dbname=' . MYSQL_SCHEMA . ';host=' . MYSQL_HOST, MYSQL_USER, MYSQL_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
}
catch (PDOException $e)
{
    die('DB-Error: ' . $e->getMessage());
}

?>